package com.kun.generator.server;

import com.kun.generator.util.FreemarkerUtil;
import freemarker.template.TemplateException;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

/**
 * @className: TestGenerator
 * @Description: 测试代码生成器
 * @author: kunkun
 * @date: 2025/7/27 21:56
 */
public class TestGenerator {
    static String toPath = "generator\\src\\main\\java\\com\\kun\\generator\\test\\";
    static {
        new File(toPath).mkdirs();
    }

    public static void main(String[] args) throws IOException, TemplateException {
        FreemarkerUtil.initConfig("test.ftl");
        HashMap<String, Object> param = new HashMap<>();
        param.put("domain","Test");
        FreemarkerUtil.generator(toPath+"Test.java",param);
    }
}
